package com.ymatou.iapi.commission.service;

import org.json.JSONArray;
import org.json.JSONObject;

import com.ymt.base.YmatouBaseCall;
import com.ymttest.utils.EnvSetup;

public class RefundCommissionRateServiceCall extends YmatouBaseCall {
	
	private static String opurl = "api/refundCommissionRate";

	public RefundCommissionRateServiceCall() {
		super(EnvSetup.getSystemUrl("commission_iapi"), opurl, "POST", "JSON");
	}

	@Override
	public void addDefHeader() {
		client.addHeader("Accept", "text/xml,text/javascript,text/html,application/json");
		client.addHeader("Content-Type", "application/json; charset=UTF-8");
	}
	
	/**
	 * 获取JSONReturnData
	 * 
	 * @return
	 */
	public JSONObject getJSONReturnData() {
		JSONObject Data = null;
		try {
			Data = new JSONObject(getReturnData());
		} catch (Exception e) {
			e.printStackTrace();
		}
		return Data;
	}
	
	/**
	 * 获取ProductRefundCommissionList
	 * 
	 * @return
	 */
	public JSONArray getProductRefundCommissionList() {
		JSONArray Data = null;
		try {
			Data = new JSONObject(getReturnData()).getJSONObject("result").getJSONArray("productRefundCommissionList");
		} catch (Exception e) {
			e.printStackTrace();
		}
		return Data;
	}
}
